package com.legendshop.openportal.sdk.service;

import com.legendshop.openportal.sdk.model.OpenResult;
import com.legendshop.openportal.sdk.model.request.v4.*;
import com.legendshop.openportal.sdk.model.response.v4.ChangeMerchantMobileV4Response;
import com.legendshop.openportal.sdk.model.response.v4.CreateMerchantV4Response;
import com.legendshop.openportal.sdk.model.response.v4.CreateShopV4Response;
import com.legendshop.openportal.sdk.model.response.v4.MerchantLoginV4Response;

public class ShopService extends BaseService {

    /**
     * 创建商户
     *
     * @param request
     * @return
     */
    public static OpenResult<CreateMerchantV4Response> createMerchant(CreateMerchantV4Request request) {
        return execute(request, CreateMerchantV4Response.class);
    }

    /**
     * 创建店铺
     *
     * @param request
     * @return
     */
    public static OpenResult<CreateShopV4Response> createShop(CreateShopV4Request request) {
        return execute(request, CreateShopV4Response.class);
    }

    /**
     * 获取商户登录授权码
     *
     * @param request
     * @return
     */
    public static OpenResult<MerchantLoginV4Response> getAuthorizeCode(MerchantLoginV4Request request) {
        return execute(request, MerchantLoginV4Response.class);
    }

    /**
     * 修改租户登录手机号
     *
     * @param request
     * @return
     */
    public static OpenResult<ChangeMerchantMobileV4Response> changeMerchantMobile(ChangeMerchantMobileV4Request request) {
        return execute(request, CreateShopV4Response.class);
    }

    /**
     * 绑定微信开放平台
     * @param request
     * @return          绑定成功的微信开放平台appid
     */
    public static OpenResult<String> bindWeixinOpenPlatformV4(ShopBindWeixinOpenPlatformV4Request request) {
        return execute(request, String.class);
    }

    /**
     * 解除绑定微信开放平台
     * @param request
     * @return
     */
    public static OpenResult<Void> unbindWeixinOpenPlatformV4(ShopUnbindWeixinOpenPlatformV4Request request) {
        return execute(request, Void.class);
    }

}
